cmake_minimum_required(VERSION 2.8)
project(boost_test)

set(CXX_FLAGS
 -g
 # -DVALGRIND
#  -DCHECK_PTHREAD_RETURN_VALUE
#  -D_FILE_OFFSET_BITS=64
#  -Wall
#  -Wextra
#  -Werror
#  -Wconversion
#  -Wno-unused-parameter
#  -Wold-style-cast
#  -Woverloaded-virtual
#  -Wpointer-arith
#  -Wshadow
#  -Wwrite-strings
#  -march=native
 # -MMD
 #-std=c++11
 # -rdynamic
 )

string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")

#设定编译类型为release，发布时需要选择release
#可能的值包括Debug、Release、RelWithDebInfo和MinSizeRel
set(CMAKE_BUILD_TYPE Release) 

#CMAKE_CXX_FLAGS g++编译选项
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
message(WARN " after ${CMAKE_CXX_FLAGS}")

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")

string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
message(STATUS "CXX_FLAGS = " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE}})


include_directories(../insdir/include)
link_directories(/home/zhaodong/boost_asio/insdir/lib)

add_executable(test_case1 test_case.cpp)
target_link_libraries(test_case1 boost_system pthread boost_coroutine boost_context)

add_executable(test_case2 test_case2.cpp)
target_link_libraries(test_case2 boost_system pthread boost_coroutine boost_context)


add_executable(test_case3 test_case3.cpp)
target_link_libraries(test_case3 boost_system pthread boost_coroutine boost_context boost_fiber)

add_executable(test_case4 test_case4.cpp)
target_link_libraries(test_case4 boost_system pthread boost_coroutine boost_context)
